﻿using FreeSql;
using FreeSql.DataAnnotations;
using System.ComponentModel;

namespace BlazorApp1.Entity
{
    [Description("菜单表")]
    public class MemuEntity : BaseEntity<MemuEntity, int>
    {
        [Description("菜单名")]
        public string? MemuName { get; set; }
        [Description("Url")]
        public string? Url { get; set; }
        [Description("图标")]
        public string? Icon { get; set; }

        public int ParentId { get; set; }
        [Navigate(nameof(ParentId))]
        public MemuEntity? Parent { get; set; }

        [Navigate(nameof(ParentId))]
        public List<MemuEntity>? Children { get; set; }

        [Navigate(ManyToMany = typeof(RoleMenuEntity))]
        public List<RoleEntity>? Roles { get; set; }
    }
}
